package shop

import (
	"gdshop-back-end-go/admin-api/app/controllers"
	"gdshop-back-end-go/admin-api/app/service/FenxiaoUserService"
	"gdshop-back-end-go/common/request/BaseReq"
	"gdshop-back-end-go/common/response"
	"github.com/gogf/gf/net/ghttp"
)

// FenxiaoUserController 分销
type FenxiaoUserController struct {
	*ShopBaseController
}

func NewFenxiaoUserController(inputReq *BaseReq.I) *FenxiaoUserController {
	return &FenxiaoUserController{
		&ShopBaseController{&controllers.BaseController{Req: inputReq}},
	}
}

func (c *FenxiaoUserController) Page(r *ghttp.Request) *response.JsonResponse {
	if err := r.Parse(&c.Req.PageInfo); err != nil {
		return response.FailByRequestMessage(r, err.Error())
	}
	return FenxiaoUserService.Page(r, c.Req)
}

func (c *FenxiaoUserController) SetStatus(r *ghttp.Request) *response.JsonResponse {
	if err := c.checkIds(r); err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	}
	return FenxiaoUserService.SetStatus(r, c.Req)
}
